package org.apache.commons.pool2;

import java.io.Closeable;
import java.util.NoSuchElementException;

/**
 * 类的描述
 *
 * @author ztkool
 * @version v
 */
public interface KeyedObjectPool<K, V> extends Closeable {

    V borrowObject(K object) throws Exception, NoSuchElementException, IllegalStateException;

    void returnObject(K object1, V object2) throws Exception;

    void invalidateObject(K object1, V object2) throws Exception;

    void addObject(K object) throws Exception, IllegalStateException, UnsupportedOperationException;

    int getNumIdle(K object);

    int getNumActive(K object);

    int getNumIdle();

    int getNumActive();

    void clear() throws Exception, UnsupportedOperationException;

    void clear(K object) throws Exception, UnsupportedOperationException;

    @Override
    void close();
}
